Skip to content

Conversation

@cpettet
Copy link
Contributor

@cpettet cpettet commented Aug 18, 2025

What is this PR doing?

Implements configurable features in the VERA application. Documentation will be in a follow-up PR as this one is already long in the tooth. Configuration is handled through a config.json file that can be moved to the frontend/public folder; there's an example in the base directory, config.example.json. Changes to the config file will be reflected immediately in most cases, but some rooms will need to be re-joined to take effect (ie setting the default layout, audio on join, etc.).

I dislike combining tickets, but the issue for the camera LED remaining on when the publisher was not publishing video was difficult to decouple from the configuration API, so it's resolved here, too. It's done by moving the BackgroundPublisherProvider up the tree, removing the need to create --> destroy --> recreate --> destroy it when moving from the waiting room to the meeting room. This simplifies the flow so it's easier to understand, too. 🙌

How should this be manually tested?

Testing configuration
  • checkout this branch
  • copy the example config file to the appropriate directory cp config.example.json frontend/public/config.json
  • for each of the configurable features, check it does what the config describes
    • allowBackgroundEffects - enables/disables the background effects buttons
    • allowCameraControl - enables/disables the video toggle (waiting and meeting room)
    • allowVideoOnJoin - disables video on joining meeting room
    • defaultResolution - changes the default resolution (recommend using 320x180 to see the difference 😬)
    • allowAdvancedNoiseSuppression - displays the ANS toggle
    • allowAudioOnJoin - disables audio on joining meeting room
    • allowMicrophoneControl - enables/disables the video toggle (waiting and meeting room)
    • allowDeviceSelection - allows device selection on waiting room or on meeting room
    • defaultLayoutMode - changes default layout on joining room (use active-speaker or grid)
    • allowSomeFeature - whether the button for the feature is shown or not
    • showParticipantList - whether the participant list button is shown and whether the hidden participants tile opens the participant list
  • delete the config file rm -rf frontend/public/config.json
  • from the landing page, confirm all settings are back to their defaults
Testing bugfix
  • go to waiting room
  • disable video
  • notice LED is not lit up
  • enter meeting room
  • notice LED is not lit up
  • enable video
  • notice publisher and background publisher have video and LED is lit up

What are the relevant tickets?

A maintainer will add this ticket number.

Resolves VIDSOL-143 and VIDSOL-195

Checklist

[✅] Branch is based on develop (not main).
[ ] Resolves a Known Issue.
[ ] If yes, did you remove the item from the docs/KNOWN_ISSUES.md?
[ ] Resolves an item reported in Issues.
If yes, which issue? Issue Number?

@cpettet cpettet force-pushed the cpettet/vidsol-143-config-file branch from d592f0b to 643099f Compare September 3, 2025 16:12
@cpettet
Copy link
Contributor Author

cpettet commented Sep 18, 2025

SonarCloud failures look to be unrelated to this PR - code duplication on frontend/src/components/MeetingRoom/BackgroundEffectsLayout/BackgroundEffectsLayout.tsx, frontend/src/components/WaitingRoom/BackgroundEffects/BackgroundEffectsLayout/BackgroundEffectsLayout.tsx, and frontend/src/Context/BackgroundPublisherProvider/useBackgroundPublisher/useBackgroundPublisher.tsx

@cpettet cpettet requested a review from Copilot September 19, 2025 15:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a configurable features system for the VERA application using a config.json file. The configuration allows administrators to enable/disable various UI elements and behaviors without code changes, including camera/microphone controls, background effects, device selection, layout modes, and meeting room buttons.

Key changes:

  • Adds a new ConfigProvider context to manage application configuration
  • Implements config loading from frontend/public/config.json with fallback defaults
  • Updates components to conditionally render based on configuration settings

Reviewed Changes

Copilot reviewed 54 out of 56 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
config.example.json Example configuration file showing all available settings
frontend/src/Context/ConfigProvider/ New configuration context and hooks for managing app settings
frontend/src/hooks/useConfigContext.ts Hook to access configuration context
frontend/src/types/session.ts Moved LayoutMode type to shared location
Various component files Updated to conditionally render based on configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines 127 to 140
<Tooltip title={tooltipTitle} aria-label={t('devices.settings.ariaLabel')}>
<div>
<IconButton
onClick={handleDeviceStateChange}
disabled={isButtonDisabled}
edge="start"
aria-label={isAudio ? 'microphone' : 'camera'}
size="small"
className="m-[3px] size-[50px] rounded-full shadow-md"
>
{renderControlIcon()}
</IconButton>
</div>
</Tooltip>
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The extra <div> wrapper around the IconButton appears to be added only to make the tooltip work with disabled buttons. Consider using a more semantic approach or adding a comment explaining why this wrapper is necessary.

Copilot uses AI. Check for mistakes.
}
disconnect();
}, [disconnect]);
destroyBackgroundPublisher();
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The destroyBackgroundPublisher call in the disconnect handler should include error handling, as destroying publishers can potentially throw exceptions that would prevent the disconnect from completing.

Suggested change
destroyBackgroundPublisher();
try {
destroyBackgroundPublisher();
} catch (error) {
console.error('Failed to destroy background publisher:', error);
}

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@behei-vonage behei-vonage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

impressive job 👏 mostly left some nits and a few suggestions. let me know what you think! 🙏

Copy link

@czoli1976 czoli1976 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some considerations about the nameing of the variables, defenitely a NIT

@@ -0,0 +1,25 @@
{
"videoSettings": {
"allowBackgroundEffects": true,
Copy link

@czoli1976 czoli1976 Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest renaming it to "allowVideoEffects" because, while currently these effects apply only to the background, the same panel could potentially be used in the future for other effects (e.g., lighting correction, eye correction).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this as a team during design review and considered Visual Effects instead of Background Effects before deciding on this naming scheme. All of our components reference BackgroundEffects and everything is currently a background effect. Let's keep as-is for now, seems like premature optimization to rename this.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok @cpettet !

Copy link
Contributor

@OscarFava OscarFava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I have just a few minor comments.

Copy link
Contributor

@OscarFava OscarFava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! I leave a minor suggestion!

behei-vonage
behei-vonage previously approved these changes Sep 23, 2025
Copy link
Contributor

@behei-vonage behei-vonage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! :shipit:

@cpettet cpettet changed the title VIDSOL-143: Implement configuration file VIDSOL-143, VIDSOL-195: Implement configuration file, Resolve camera LED bug turning on when not publishing video Sep 24, 2025
@cpettet cpettet changed the title VIDSOL-143, VIDSOL-195: Implement configuration file, Resolve camera LED bug turning on when not publishing video VIDSOL-143: Implement configuration file, VIDSOL-195: Resolve camera LED bug turning on when not publishing video Sep 24, 2025
@sonarqubecloud
Copy link

Copy link
Contributor

@OscarFava OscarFava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@behei-vonage behei-vonage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dwivedisachin
Copy link
Contributor

dwivedisachin commented Sep 30, 2025

I tested the PR and overall it looks good, but I noticed a couple of things that seem a bit off:

  • If the camera or mic (or both) are disabled, why do we still request access to them?
  • When the camera/mic is disabled, having the option to select a device doesn’t feel intuitive.

Not sure if this is something we actually need to fix, but it stood out to me.

We might also want to add comments in the config.example.json file to clarify:

  • the resolutions we support (e.g., 1280x720) and the fallback to 1280x720 if we enter something else.
  • the layout modes we support (active-speaker, grid)

This would make it easier for others to understand the available options when configuring defaults.

@cpettet
Copy link
Contributor Author

cpettet commented Sep 30, 2025

If the camera or mic (or both) are disabled, why do we still request access to them?

Oh, good catch. This would require a lot of rewiring. Could this be in a follow-up PR?

When the camera/mic is disabled, having the option to select a device doesn’t feel intuitive.

Yeah, this one is a little strange. We have a configurable prop for device selection, meetingRoomSettings.allowDeviceSelection, that is separate from videoSettings.allowCameraControl. Is it okay if we keep as-is? We could also rename allowCameraControl to something more intuitive. What do you think?

@cpettet
Copy link
Contributor Author

cpettet commented Sep 30, 2025

The comments on usage will be in a separate PR. It should be this ticket: VIDSOL-165

@dwivedisachin
Copy link
Contributor

Thanks @cpettet!! merging this PR.

@dwivedisachin dwivedisachin merged commit 2b366f5 into develop Sep 30, 2025
10 of 12 checks passed
@dwivedisachin dwivedisachin deleted the cpettet/vidsol-143-config-file branch September 30, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants